
//引入api
import {requestCategoryList} from '@/api'

const state = {
  categoryList: []
}

const mutations = {
  SET_CATEGORYLIST_STATE(state, value) {
    state.categoryList = value
  }

}
const actions = {
  async getCategoryList({ commit }) {
    const result = await requestCategoryList()
    commit("SET_CATEGORYLIST_STATE", result)
  }
}

const getters = {}

export default {
  //重要:打开命名空间
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}